package com.xgjweb.fsi.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.xgjweb.common.action.XgjWebAction;
import com.xgjweb.fsi.domain.Album;
import com.xgjweb.fsi.domain.Picture;
import com.xgjweb.fsi.service.IPictureService;

/**
 */
public class PictureAction extends XgjWebAction {
	IPictureService pictureService;

	public void setPictureService(IPictureService pictureService) {
		this.pictureService = pictureService;
	}

	/**
	 * 删除相片
	 */
	public Boolean deletePicture(Picture picture) throws Exception {
		return pictureService.deletePicture(picture);
	}

	/**
	 * 查询相片
	 */
	public List<Picture> queryPicture(Album  album) throws Exception {
		return pictureService.queryPicture(album);
	}
	
	/**
	 * 查询相片根据相册
	 */
	public List<Picture> queryPictureByAlbum(Album album) throws Exception {
		return  pictureService.queryPictureByAlbum(album);
	}

	/**
	 * 查找相片
	 */
	public Picture findPicture(Picture picture) throws Exception {
		return pictureService.findPicture(picture);
	}

	/**
	 * 更新相片
	 */
	public Boolean updatePicture(Picture picture) throws Exception {
		return pictureService.updatePicture(picture);
	}

	/**
	 * 添加相片
	 */
	public ActionForward addPicture(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return pictureService.addPicture(mapping, form, request, response);
	}

	/**
	 * 添加相册
	 */
	public Boolean addAlbum(Album album) throws Exception {
		return pictureService.addAlbum(album);
	}

	/**
	 * 更改相册
	 */
	public Boolean updateAlbum(Album album) throws Exception {
		return pictureService.updateAlbum(album);
	}

	/**
	 * 删除相册
	 */
	public Boolean deleteAlbum(Album album) throws Exception {
		return pictureService.deleteAlbum(album);
	}

	/**
	 * 查找相册
	 */
	public Album findAlbum(Album album) throws Exception {
		return pictureService.findAlbum(album);
	}

	/**
	 * 查寻相册
	 */
	public List<Album> queryAlbum() throws Exception {
		return pictureService.queryAlbum();
	}
}
